package internal

import (
	"base"
	"github.com/golang/protobuf/proto"
	"reflect"
)

type protocol struct {
}

var Protocol = new(protocol)

func (*protocol) Register(msg proto.Message, method interface{}) {
	Skeleton.AfterInit(func() {
		base.Processor.SetRouter(msg, Skeleton.ChanRPCServer)
		Skeleton.RegisterChanRPC(reflect.TypeOf(msg), method)
	})
}
